const app = getApp()

Page({

  /**
   * 页面的初始数据
   */
  data: {
    count: 2,
  },

  onLoad() {
    this.countDown();
  },

  go() {
    wx.switchTab({
          url: '/pages/map/map',
    })
  },
  countDown: function () {
    let that = this;
    let total = 2;
    this.interval = setInterval(function () {
      total > 0 && (total--, that.setData({
            count: total
      })), 0 === total && (that.setData({
            count: total
      }), wx.switchTab({
            url: "/pages/map/map"
      }), clearInterval(that.interval));
    }, 1e3);
  },
})